<!-- 轮播图 -->
<template>
	<view>
		<view class="swiper-box">
			<swiper class="swiper" circular :indicator-dots="false" :autoplay="false" :interval="5000" :duration="500">
				<swiper-item v-for="(item,index) in swiperUrl" :key="index" >
					<view class="swiper-item" @click="jump(item)">
						<image :src="item.image" mode=""></image>
					</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	import * as index from '@/api/index.js'
	export default {
	
		data() {
			return {
				swiperUrl:[
					{
						image:''
					}
				]
			}
		},
		watch: {

		},
		created() {
			index.getBannerList().then(res=>{
				this.swiperUrl = res.data
			})
		},
		methods: {
			//跳转轮播详情
			jump(item){
				let that = this
				uni.setStorage({
					key: 'link',
					data: item.link,
					success: function () {
						that.$tools.navigate('/pages/home/webView/index')
					}
				});
			}
		}
	}
</script>

<style scoped lang="scss">
	.swiper-box{
		width: 100%;
		height: 200rpx;
		.swiper{
			height: 100%;
			width: 100%;
			.swiper-item{
				height: 100%;
				width: 100%;
				image{
					height: 100%;
					width: 100%;
				}
			}
		}
	}
</style>
